package qianting.news.wemedia.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import qianting.news.apis.models.wemedia.dtos.WmMaterialDto;
import qianting.news.common.entity.State;
import qianting.news.wemedia.service.WmMaterialService;

@Api(tags = "素材管理")
@RestController
@RequestMapping("/material")
public class WmMaterialController {

    @Autowired
    private WmMaterialService wmMaterialService;

    //根据用户信息上传素材
    @ApiOperation(value = "根据用户信息上传素材")
    @PostMapping("upload_picture")
    public State uploadPicture(MultipartFile multipartFile){
        return wmMaterialService.uploadPicture(multipartFile);
    }

    //查询用户的素材列表
    @ApiOperation(value = "查询用户的素材列表")
    @PostMapping("/list")
    public State findList(@RequestBody WmMaterialDto dto){
        return wmMaterialService.findList(dto);
    }

}